package com.boot.dog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.boot.dog.entities.ao.RoleAo;
import com.boot.dog.entities.pojo.Role;
import com.boot.dog.entities.pojo.RolePermission;
import com.boot.dog.entities.vo.RoleVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: MaxLv
 * @Date: 2019/12/2
 */
public interface RoleMapper extends BaseMapper<Role> {

    List<Role> selectRolesByUserId(@Param("userId") int userId);

    IPage<RoleVo> selectByPage(Page page, @Param("ao") RoleAo ao);

    List<RolePermission> selectPermissionIdsByRoleId(@Param("roleId") Integer roleId);

    List<Role> selectAllRole(@Param("currentUser") String currentUser);
}
